package com.wanmait.recruitment.service.impl;


import com.github.pagehelper.PageInfo;
import com.wanmait.recruitment.mapper.MessageMapper;
import com.wanmait.recruitment.pojo.Message;
import com.wanmait.recruitment.service.MessageService;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class MessageServiceImpl implements MessageService {

    @Resource
    private MessageMapper messageMapper;
    @Override
    @CacheEvict(value = "messageCache",allEntries = true)
    public int insertResume(Message message) {
        return messageMapper.insertResume(message);
    }

    @Override
    @Cacheable("messageCache")
    public List<Message> findByUserinfoId(Message message) {
        return messageMapper.findByUserinfoId(message);
    }

    @Override
    public int findCount(Message message) {
        return messageMapper.findCount(message);
    }

    @Override
    @CacheEvict(value = "messageCache",allEntries = true)
    public int deleteUserId(Message message) {
        return messageMapper.deleteUserId(message);
    }

    @Override
    public int findCompanyId(Message message) {
        return messageMapper.findCompanyId(message);
    }

    @Override
    @CacheEvict(value = "messageCache",allEntries = true)
    public int insertUserDeliver(Message message) {
        return messageMapper.insertUserDeliver(message);
    }

    @Override
    public int deleteCompany(Message message) {
        return messageMapper.deleteCompany(message);
    }

    @Override
    public void insert(Message object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(Message object) {

    }

    @Override
    public Message findById(Integer id) {
        return null;
    }

    @Override
    public List<Message> findAll() {
        return null;
    }

    @Override
    public List<Message> findAll(Message object) {
        return null;
    }

    @Override
    public PageInfo<Message> findPage(int pageNum, int pageSize) {
        return null;
    }
}
